<template>
  <div>
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="角色名称">
        <el-input v-model="form.RoleName"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="RoleUpd">保存</el-button>
        <el-button @click="this.UpddialogVisibles = false">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  props: {
    Roleids: null,
  },
  data() {
    return {
      form: {},
      UpddialogVisibles: false,
    };
  },
  methods: {
    //角色修改
    RoleUpd() {
      this.axios
        .put("http://localhost:15670/api/RoleUser/RoleUpdate", this.form)
        .then((res) => {
          if (res.data.Success) {
            this.$message.success(res.data.Message);
            this.$emit("UpdesRpe");
          } else {
            this.$message.success(res.data.Message);
          }
        });
    },
    //角色获取
    GetrRole() {
      this.axios
        .get("http://localhost:15670/api/RoleUser/RoleGet?id=" + this.Roleids)
        .then((res) => {
          this.form = res.data.Data;
        });
    },
  },
  created() {
    this.GetrRole();
  },
};
</script>
<style>
</style>